package com.cnhis.cloudhealth.clidoctorweb.advicevaluation;

import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;


import org.jboss.resteasy.logging.Logger;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.cnhis.cloudhealth.clinical.clidoctor.advicevaluation.service.IAdviceValuation;
import com.cnhis.cloudhealth.commons.Mappers.ModelVo;
import java.util.HashMap;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

@Path("advicevaluation")
@Component
public class AdviceValuationRest
{
	public static void main(String[] args) {
		
	}
    Logger log = Logger.getLogger(AdviceValuationRest.class);
    
    @Reference
    private IAdviceValuation adviceValuation;
    
    /* ScriptId(1031) */
    /* Description(未发送临时医嘱计价内容：手术) */
    /**
     * 
     * @param lVAFID 医嘱id
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @POST
    @Path("unsendadvicevaluation")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo unSendAdviceValuation(@FormParam("lVAFID") long lVAFID)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("lVAFID", lVAFID);
        Date n = new Date();
        DateFormat sdf  = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String aDate = sdf.format(n);
        map.put("aDate", aDate);
        return adviceValuation.unSendAdviceValuation(map);
        
    }
    
    /**
     * 材料新开医嘱计价信息查询
     *  ScriptId(7493) 
     * @param lVAFID 医嘱id
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @POST
    @Path("unsendadvicevaluationCailiao")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo unsendadvicevaluationCailiao(@FormParam("lVAFID") long lVAFID)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("lVAFID", lVAFID);
        Date n = new Date();
        DateFormat sdf  = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String aDate = sdf.format(n);
        map.put("aDate", aDate);
        return adviceValuation.unsendadvicevaluationCailiao(map);
        
    }
    
    
    /* ScriptId(843) */
    /* Description(未发送临时医嘱计价内容：中草药) */
    /**
     * 
     * @param lVAFID 医嘱id
     * @param aDate
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @POST
    @Path("unSendAdviceZhongyaoValuation")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo unSendAdviceZhongyaoValuation(@FormParam("lVAFID") long lVAFID, @FormParam("aDate") String aDate)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("lVAFID", lVAFID);
        map.put("aDate", aDate);
        return adviceValuation.unSendAdviceZhongyaoValuation(map);
        
    }
    
    /* ScriptId(844) */
    /* Description(未发送临时医嘱计价内容：西、成药) */
    /**
     * 
     * @param lVAFID 医嘱id
     * @param aDate
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @POST
    @Path("unSendAdviceXiyaoValuation")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo unSendAdviceXiyaoValuation(@FormParam("lVAF01A") long lVAFID, @FormParam("aDate") String aDate)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("lVAF01A", lVAFID);
        map.put("aDate", aDate);
        return adviceValuation.unSendAdviceXiyaoValuation(map);
        
    }
    
    /* ScriptId(1037) */
    /* Description(已发送临时医嘱计价内容：手术) */
    /**
     * 
     * @param lVAFID 医嘱id
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @POST
    @Path("sendedadvicevaluation")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo sendedAdviceValuation(@FormParam("lVAFID") long lVAFID)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("lVAFID", lVAFID);
        return adviceValuation.sendedAdviceValuation(map);
    }
    
    /* ScriptId(1036) */
    /* Description(已发送临时医嘱计价内容：中草药) */
    /**
     * 
     * @param lVAFID 医嘱id
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @POST
    @Path("sendedAdviceCaoyaoValuation")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo sendedAdviceCaoyaoValuation(@FormParam("lVAFID") long lVAFID)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("lVAFID", lVAFID);
        return adviceValuation.sendedAdviceCaoyaoValuation(map);
    }
    
    /* ScriptId(7485) */
    /* Description(门诊发送医嘱窗口，提取对应计价信息) */
    /**
     * 
     * @param lVAF06 就诊id
     * @param lBCE01A 操作员id
     * @param aDate 日期
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @POST
    @Path("getchargeinfo")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo getChargeInfo(@FormParam("lVAF06") int lVAF06, @FormParam("lBCE01A") int lBCE01A,
        @FormParam("aDate") String aDate)
        throws Exception
    {
        
        HashMap map = new HashMap();
        map.put("lVAF06", lVAF06);
        map.put("lBCE01A", lBCE01A);
        map.put("aDate", aDate);
        return adviceValuation.getChargeInfo(map);
    }
    
    /* ScriptId(1089) */
    /* Description(除药品外医嘱计价：收费项目检索) */
    /**
     * 
     * @param bby01 收费项目id
     * @param adate 有效期
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @POST
    @Path("findfeeitem")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo findFeeItem(@FormParam("bby01") int bby01, @FormParam("adate") String adate)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("bby01", bby01);
        map.put("adate", adate);
        return adviceValuation.findFeeItem(map);
    }
    
    /* ScriptId(1088) */
    /* Description(药品临嘱计价时，检索对应药品规格) */
    /**
     * 
     * @param lACF01 1
     * @param lBBY01 收费项目id
     * @param lBCK01 部门id
     * @param ABC02 费别名称
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @POST
    @Path("finddrugspecification")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo findDrugSpecification(@FormParam("lACF01") int lACF01, @FormParam("lBBY01") int lBBY01,
        @FormParam("lBCK01") int lBCK01, @FormParam("ABC02") String ABC02)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("lACF01", lACF01);
        map.put("lBBY01", lBBY01);
        map.put("lBCK01", lBCK01);
        map.put("ABC02", ABC02);
        return adviceValuation.findDrugSpecification(map);
    }
    
    /* ScriptId(1032) */
    /* Description(未发送临时医嘱计价内容：其它类别医嘱项目) */
    @SuppressWarnings("unchecked")
    @POST
    @Path("otheradvicecharg")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo otherAdviceCharg(@FormParam("lVAFID") long lvafid, @FormParam("aDate") String aDate)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("lVAFID", lvafid);
        map.put("aDate", aDate);
        return adviceValuation.otherAdviceCharg(map);
    }
    
    /* ScriptId(1038) */
    /* Description(已发送临时医嘱计价内容：其它类别医嘱项目) */
    @SuppressWarnings("unchecked")
    @POST
    @Path("sendotheradvice")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo sendOtheradvice(@FormParam("VAF01") long VAF01, @FormParam("acf01") long acf01)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("VAF01", VAF01);
        map.put("acf01", acf01);
        return adviceValuation.sendOtheradvice(map);
    }
    
    /* ScriptId(1035) */
    /* Description(已发送临嘱医嘱计价内容：西、成药) */
    @SuppressWarnings("unchecked")
    @POST
    @Path("sendtempadvicevaluation")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo sendTempAdviceValuation(@FormParam("acf01") long acf01, @FormParam("lVAF01") long lVAF01,
        @FormParam("lVAF01A") long lVAF01A,@FormParam("date1") String date1 ,
                                           @FormParam("date2") String date2)
        throws Exception
    {
        HashMap map = new HashMap();
        map.put("lVAF01", lVAF01);
        map.put("acf01", acf01);
        map.put("lVAF01A", lVAF01A);
        map.put("date1", date1);
        map.put("date2", date2);
        return adviceValuation.sendTempAdviceValuation(map);
    }
    
    /* ScriptId(2118) */
    /* Description(医嘱发送前的参数查询) */
    @SuppressWarnings("unchecked")
    @POST
    @Path("queryForSendParams")
    @Produces({MediaType.APPLICATION_JSON})
    public ModelVo queryForSendParams(@FormParam("cbm01") long cbm01,
        @FormParam("lVAF01A") long lVAF01A)
            throws Exception
    {
        HashMap map = new HashMap();
        map.put("cbm01", cbm01);
        return adviceValuation.queryForSendParams(map);
    }
}
